package com.mission.game.utils;

import java.io.Serializable;

import android.app.Activity;

import com.mission.game.R;
import com.mission.game.components.Statusable;

public abstract class Task extends Activity implements Serializable, Statusable {

	private static final long serialVersionUID = -1381790741171350554L;

	public static final int DEFAULT_SCORE = 100;

	int _score;
	String _name;
	String _description;
	Status _status;
	Mission _mission;

	public Task(int score, String name, String description, Status status,
			Mission mission) {
		super();
		_score = score;
		_name = name;
		_description = description;
		_status = status;
		_mission = mission;
	}

	public Task(String name, String description, Mission mission) {
		this(DEFAULT_SCORE, name, description, Status.NOT_STARTED, mission);
	}

	public int getScore() {
		return _score;
	}

	public void setScore(int score) {
		_score = score;
	}

	public String getName() {
		return _name;
	}

	public void setName(String name) {
		_name = name;
	}

	public String getDescription() {
		return _description;
	}

	public void setDescription(String description) {
		_description = description;
	}

	public int getStatusImg() {
		switch (_status) {
		case NOT_STARTED:
			return R.drawable.choose_arrow;
		case COMPLETED:
			return R.drawable.hand_good;
		case WAITING_FOR_VERIFICATION:
			return R.drawable.star_full;
		case REJECTED:
			return R.drawable.hand_bad;
		default:
			return 0;
		}
	}

	public void setStatus(Status status) {
		_status = status;
	}

	public Status getStatus() {
		return _status;
	}
	
	public Mission getMission() {
		return _mission;
	}

	public void setMission(Mission mission) {
		_mission = mission;
	}

	public abstract Class<?> getCreateClass();
	public abstract Class<?> getPlayClass();

	public boolean hasMission() {
		return _mission != null;
	}
}
